package cn.itcast.nems.studentrecord.converter;

import cn.itcast.nems.order.dto.PaymentFlowDTO;
import cn.itcast.nems.studentrecord.enumeration.FundFlowPaymentTypeEnum;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author liyong
 * create: 2023-11-28 13:58:51
 **/
public class PaymentFlowConverter {


    /**
     * 创建“退转”订单支付流水
     *
     * @param orderId   订单ID
     * @param amount    金额
     * @param journalNo 凭单行号
     * @param bizDate   业务日期
     * @return 订单支付流水
     */
    public static PaymentFlowDTO createPaymentFlowDTO(String orderId,
                                                      int amount,
                                                      String journalNo,
                                                      LocalDateTime bizDate) {
        PaymentFlowDTO dto = new PaymentFlowDTO();
        dto.setOrderId(orderId);
        dto.setJournalType(FundFlowPaymentTypeEnum.REFUND_TRANSFER.name());
        dto.setJournalNo(journalNo);
        dto.setAmount(amount);
        dto.setCharge(0);
        dto.setChargeRate(BigDecimal.ZERO);
        dto.setBizDate(bizDate);
        dto.setPaymentMethodCode("");
        dto.setPaymentMethodName("");
        dto.setPaymentAccountCode("");
        dto.setPaymentAccountName("");
        dto.setRemark("班级变更费用转移");
        return dto;
    }
}
